home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 1997 April to September / Sun Solutions CD - APR '97 - SEP '97 (704-3778-12 Rev. H)(Sun Microsystems, Inc.)(1997).iso / products / bin /  next >
Text File  |  1997-01-21  |  40KB  |  1,215 lines

  1. #!/usr/lab/bin/perl 
  2. # ------------------------------------------------------------
  3.  
  4. # update.pl, by Jean-Pierre Girard (jpg@corrado.sun.com)
  5. # This allows the user to edit or create the _info file
  6. # necessary for the SunSolutions.
  7. # version 1.0, Feb, 20 1996
  8. # ------------------------------------------------------------
  9.  
  10. # Bugs and other fixes
  11.  
  12. # ------------------------------------------------------------
  13. %Special = (
  14. "internet", "596,200"
  15. ,"Sun", "596,167"
  16. );
  17.  
  18. %GifImage = (
  19. "archive", "sstormn.gif"
  20. ,"business", "sbizsol.gif"
  21. , "cad_cae", "scade.gif"
  22. , "catalogs", "scata.gif"
  23. , "client_server", "sclnt.gif"
  24. , "desktop_apps", "sdesk.gif"
  25. , "diag_flow", "sdiaflo.gif"
  26. , "doc_mgt", "sdocmn.gif"
  27. , "epubs", "selecpb.gif"
  28. , "graphics_imaging", "sgfximg.gif"
  29. , "info_mgt", "sinfomn.gif"
  30. , "multimedia", "smulti.gif"
  31. , "networking", "snetwk.gif"
  32. , "security", "ssecu.gif"
  33. , "sw_eng", "ssfteng.gif"
  34. , "sys_admin", "ssysad.gif"
  35. , "telco", "stelco.gif"
  36. , "training", "strain.gif"
  37. #Below are not subs
  38. , "access", "intacc.gif"
  39. , "service", "intserv.gif"
  40. , "commerce", "intcomm.gif"
  41. , "publishing", "intpub.gif"
  42. , "intsecurity", "intsec.gif"
  43. , "Hardware", "hard.gif"
  44. , "Services", "serv.gif"
  45. , "companies", "comps.gif"
  46. , "Sun", "sprods.gif"
  47. # Added for March 97 Issue
  48.  
  49. , "financial", "financial.gif"
  50. , "utilities", "utilities.gif"
  51. , "intauth", "intauth.gif"
  52. , "intcontmgt", "intcontmgt.gif"
  53. , "intdbconn", "intdbconn.gif"
  54. , "intemail", "intemail.gif"
  55. , "intgrpware", "intgrpware.gif"  
  56. , "intoffprod", "intoffprod.gif"
  57. , "intprodauth", "intprodauth.gif"
  58. , "intsrcheng", "intsrcheng.gif"
  59. , "intstemgt", "intstemgt.gif"
  60. , "intswdev", "intswdev.gif"
  61. , "intwebad", "intwebad.gif"
  62. , "intwebcms", "intwebcms.gif"    
  63. , "intwebdw", "intwebdw.gif"
  64. , "intwebmon", "intwebmon.gif"
  65. , "intwebserv", "intwebserv.gif"   
  66. , "intwebste", "intwebste.gif" 
  67. , "intwebvideo", "intwebvideo.gif"
  68. , "intwebvoice", "intwebvoice.gif"
  69. );
  70. %CatHeight = (
  71. "access", ""
  72. , "service", ""
  73. , "commerce", ""
  74. , "publishing", ""
  75. , "intsecurity", ""
  76. #Added Specifically for March 97 Issue
  77. , "intauth", ""
  78. , "intcontmgt", ""
  79. , "intdbconn", ""
  80. , "intemail", ""
  81. , "intgrpware", ""
  82. , "intoffprod", ""
  83. , "intprodauth", ""
  84. , "intsrcheng", ""
  85. , "intstemgt", ""
  86. , "intswdev", ""
  87. , "intwebad", ""
  88. , "intwebcms", ""
  89. , "intwebdw", ""
  90. , "intwebmon", ""
  91. , "intwebserv", ""
  92. , "intwebste", ""
  93. , "intwebvideo", ""
  94. , "intwebvoice", ""
  95. #Main Categories from March 97 front GUI
  96. , "Hardware", ""
  97. , "Services", ""
  98. , "companies", ""
  99. , "Sun", ""
  100. #These are Software subs
  101. ,"archive", ""
  102. ,"business", ""
  103. , "cad_cae", ""
  104. , "catalogs", ""
  105. , "client_server", ""
  106. , "desktop_apps", "220"
  107. , "diag_flow", ""
  108. , "doc_mgt", ""
  109. , "epubs", ""
  110. , "graphics_imaging", ""
  111. , "info_mgt", ""
  112. , "multimedia", ""
  113. , "networking", ""
  114. , "security", ""
  115. , "sw_eng", ""
  116. , "sys_admin", ""
  117. , "telco", ""
  118. , "training", ""
  119. #Added for March 97 Issue
  120. , "financial", "220"
  121. , "utilities", "220"
  122. );
  123.  
  124. %Categories = (
  125. "access", "Internet Access"
  126. , "service", "Services for the Internet"
  127. , "commerce", "Internet Commerce"
  128. , "publishing", "Internet Publishing"
  129. , "intsecurity", "Internet Security"
  130. #Added Specifically for March 97 Issue
  131. , "intauth", "Internet Authoring/Java"
  132. , "intcontmgt", "Internet Content Management"
  133. , "intdbconn", "Internet Database Connectivity"
  134. , "intemail", "Internet Email"
  135. , "intgrpware", "Internet Groupware/Document Flow"
  136. , "intoffprod", "Internet Office Productivity"
  137. , "intprodauth", "Internet Production/Authoring"
  138. , "intsrcheng", "Internet Search Engines"
  139. , "intstemgt", "Internet Site Management"
  140. , "intswdev", "Internet Software Development Tools"
  141. , "intwebad", "Internet Web Advertising"
  142. , "intwebcms", "Internet Web CMS"
  143. , "intwebdw", "Internet Web Datawarehouse"
  144. , "intwebmon", "Internet Web Monitoring"
  145. , "intwebserv", "Internet Web Server"
  146. , "intwebste", "Internet Web Site"
  147. , "intwebvideo", "Internet Web Video"
  148. , "intwebvoice", "Internet Web Voice"
  149. #Main Categories from March 97 front GUI
  150. , "Hardware", ""
  151. , "Services", ""
  152. , "companies", ""
  153. , "Sun", "Search Sun Products <form method=get ACTION=http://localhost:7999/cgi-bin/brandnewwais.pl/wais_SunSolutions></font><input type=text name=isindex size=15>"
  154. #These are Software subs
  155. ,"archive", "Archiving, Storage Management & Backup Solutions"
  156. ,"business", "Business Solutions"
  157. , "cad_cae", "Computer Aided Design/Engineering"
  158. , "catalogs", "Catalogs"
  159. , "client_server", "Client/Server Solutions"
  160. , "desktop_apps", "Desktop Applications"
  161. , "diag_flow", "Diagramming and Flowcharting"
  162. , "doc_mgt", "Document Management"
  163. , "epubs", "Electronic Publishing"
  164. , "graphics_imaging", "Graphics and Imaging"
  165. , "info_mgt", "Information Management"
  166. , "multimedia", "Multimedia"
  167. , "networking", "Networking"
  168. , "security", "Security"
  169. , "sw_eng", "Software Engineering"
  170. , "sys_admin", "System Administration"
  171. , "telco", "Telecommunications"
  172. , "training", "Training"
  173. #Added for March 97 Issue
  174. , "financial", "Financial Services"
  175. , "utilities", "Utilities"
  176. );
  177.  
  178. ##############################################################################
  179. # PrintHtml:
  180. ##############################################################################
  181. sub PrintHtml
  182. {
  183.     local($StrHtml1, $Str, $StrHtml2) = @_;
  184.     
  185.     if ($HTML_FORMAT eq "true") {
  186.         print STDOUT $StrHtml1;
  187.     }
  188.  
  189.     print STDOUT $Str;
  190.  
  191.     if ($HTML_FORMAT eq "true") {
  192.         print STDOUT $StrHtml2;
  193.     }
  194. }
  195. ##############################################################################
  196. # CheckLinks:
  197. ##############################################################################
  198. sub CheckLinks
  199. {
  200.     &PrintHtml("<BR>", "\nChecking links1...\n", "<BR>");
  201.     $ListDir = `cd $PRODUCTS_DIR; ls`;
  202.     $ListDir =~ s/gui|SunSolutions|DEV|hotjava|tempjas|temp//g;
  203.     #$ListDir =~ s/\n+/ /g;
  204.     @dirfields = split(/\s+/, $ListDir);
  205.     foreach $Dir (@dirfields) {
  206.         if ($Dir =~ /SunSolutions|DEV/) {
  207.             next;
  208.         }
  209.         &PrintHtml("<DD><DD>",  "\t\tTesting $Dir ...\n", "<BR>");
  210.         $ListFiles = `find "$PRODUCTS_DIR/$Dir" -name "*.html" -print`;
  211.         $ListFiles .= `find "$PRODUCTS_DIR/$Dir" -name "*.htm" -print`;
  212.         #$ListDir =~ s/gui|SunSolutions|DEV|hotjava|tempjas|temp//g;
  213.         @filefields = split(/\s+/, $ListFiles);
  214.         foreach $File (@filefields) {
  215.             if ($File =~ /SunSolutions.(frame|head).html/) {
  216.                 next;
  217.             }
  218.             #&PrintHtml("<DD><DD>",  "\t\tTesting $File ...\n", "<BR>");
  219.             if (open (HTMLFILE, $File)) {
  220.                 while(<HTMLFILE>) {
  221.                     chop;
  222.                     $Line = $_;
  223.                     $LinePrint = $Line;
  224.                     if ($HTML_FORMAT eq "true") {
  225.                         $LinePrint =~ s/</</g;
  226.                         $LinePrint =~ s/>/>/g;
  227.                     }
  228.                     if ($Line =~ /HREF/i) {
  229.                         $Ref = $Line;
  230.                         $Ref =~ s/.*HREF *= *"?([^" >#]*)[" >#].*/\1/i;
  231.                         if ($Ref =~ /HrefButtonArea/) {
  232.                             $Ref =~ s/.*HrefButtonArea,\d+,\d+,\d+,\d+,([^" >]*)/\1/;
  233.                         }
  234.                         #print "\t$Line\n\t->$Ref\n";
  235.                         if ($Ref eq $Line) {
  236.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  237.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  238.                         }
  239.                         if ($Ref eq "" && $Line !~ /HREF *= *"?\#/i) {
  240.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  241.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  242.                         }
  243.                         if ($Ref !~ /mailto:|ftp:|http:\/\/|req_more_info.pl/i || $Ref =~ /http:\/\/localhost/) {
  244.                         #if ($Ref !~ /mailto:|ftp:|http:\/\/[^l]|req_more_info.pl/i) {
  245.                             #print "->$Ref\n";
  246.                             $ShortDir = $File;
  247.                             $ShortDir =~ s?(.*\/)[^/]*$?\1?;
  248.                             if ($Ref =~ /http:\/\/localhost/i) {
  249.                                 $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  250.                                 #print "\t\tin http:$ShortDir/$Ref from $File\n";
  251.                                 if ($Ref !~ /cgi-bin/ && ! -s "$ShortDir/$Ref") {
  252.                                     &PrintHtml("<B>", "ERROR: Missing link $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  253.                                 }
  254.                             } elsif ($Ref =~ /file:/i) {
  255.                                 $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  256.                                 #print "\t\tin file: $Ref from $File\n";
  257.                                 unless (-s "$Ref") {
  258.                                     &PrintHtml("<B>", "ERROR: Missing link $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  259.                                 }
  260.                             } else {
  261.                                 #print "\t\tin else: $ShortDir/$Ref from $File\n";
  262.                                 if ($Ref !~ /^#/) {
  263.                                     unless ($Ref !~ /^#/ && -s "$ShortDir/$Ref") {
  264.                                         &PrintHtml("<B>", "ERROR: Missing link $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  265.                                     }
  266.                                 }
  267.                             }
  268.                         }
  269.                         
  270.                     }
  271.                     if ($Line =~ /<IMG/i) {
  272.                         $Ref = $Line;
  273.                         $Ref =~ s/.*IMG.*SRC *= *"?([^" >]*)[" >].*/\1/i;
  274.                         #print "\t$Line\n\t->$Ref\n";
  275.                         if ($Ref eq $Line) {
  276.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  277.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  278.                         }
  279.                         if ($Ref eq "") {
  280.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  281.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  282.                         }
  283.                         #print "->$Ref\n";
  284.                         $ShortDir = $File;
  285.                         $ShortDir =~ s?(.*\/)[^/]*$?\1?;
  286.                         if ($Ref =~ /http:\/\/localhost/i) {
  287.                             $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  288.                             #print "\t\tin http:$ShortDir/$Ref from $File\n";
  289.                             if ($Ref !~ /cgi-bin/ && ! -s "$ShortDir/$Ref") {
  290.                                 &PrintHtml("<B>", "ERROR: Missing image $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  291.                             }
  292.                         } elsif ($Ref =~ /file:/i) {
  293.                             $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  294.                             #print "\t\tin file: $Ref from $File\n";
  295.                             unless (-s "$Ref") {
  296.                                 &PrintHtml("<B>", "ERROR: Missing image $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  297.                             }
  298.                         } else {
  299.                             #print "\t\tin else: $ShortDir/$Ref from $File\n";
  300.                             if ($Ref !~ /^#/) {
  301.                                 unless ($Ref !~ /^#/ && -s "$ShortDir/$Ref") {
  302.                                     &PrintHtml("<B>", "ERROR: Missing image $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  303.                                 }
  304.                             }
  305.                         }
  306.                         
  307.                     }
  308.                     #$Line =~ tr/
  309.                 }
  310.                 close(HTMLFILE);
  311.             } else {
  312.                 &PrintHtml("<B>",  "ERROR: $File cannot be open\n", "</B><BR>");
  313.             }
  314.         }
  315.     }
  316. }
  317. ##############################################################################
  318. # CheckFiles:
  319. ##############################################################################
  320. sub CheckFiles
  321. {
  322.     $ListDir = `cd $PRODUCTS_DIR; ls`;
  323.     $ListDir =~ s/gui|SunSolutions|DEV|hotjava|tempjas|temp//g;
  324.     #$ListDir =~ s/\n+/ /g;
  325.     @filefields = split(/\s+/, $ListDir);
  326.     foreach $Dir (@filefields) {
  327.         unless (-s "$PRODUCTS_DIR/$Dir/_info") {
  328.             &PrintHtml("", "WARNING: _info file missing in $Dir\n", "<BR>");
  329.         }
  330.     }
  331.     #print $ListDir;
  332. }
  333.  
  334. ##############################################################################
  335. # InitCompInfo:
  336. ##############################################################################
  337. sub InitCompInfo
  338. {
  339.     #$ListDir = `ls $PRODUCTS_DIR/[CD]*/_info`;
  340.     $ListDir = `ls $PRODUCTS_DIR/*/_info`;
  341.     #print "ls $PRODUCTS_DIR/*/_info";
  342.  
  343.     @filefields = split(/\s+/, $ListDir);
  344.     #print $filefields;
  345.     foreach $INFOFILENAME (@filefields) {
  346.         $ShortDir = $INFOFILENAME;
  347.         $ShortDir =~ s?.*/([^/]*)/_info$?\1?;
  348.         if (-l "$PRODUCTS_DIR/$ShortDir") {
  349.             next;
  350.         }
  351.         if (-s $INFOFILENAME && open (INFOFILE, $INFOFILENAME)) {
  352.             if ($REPORT ne "true") {
  353.                 #&PrintHtml("<DD><DD>", "\t\tReading $INFOFILENAME\n", "<BR>");
  354.             }
  355.     
  356.                     while (<INFOFILE>) {
  357.                         $Line = $_;
  358.                 unless ($Line =~ /^[     ]*$/ || $Line =~ /^#/) {
  359.                     last;
  360.                 }
  361.             }
  362.                     ($Companies{$ShortDir}, $Description{$ShortDir}, $Platform{$ShortDir}, $ChosenCat{$ShortDir}, $WebSite{$ShortDir}, $Email{$ShortDir}, $HomePageName{$ShortDir}) = split(/\^/, $Line);
  363.  
  364.             if ($CHECK eq "true") {
  365.                 $_ = $Line;
  366.                 #print "Line=$Line\n";
  367.                 $count = tr/^//;
  368.                 #print "$_: $count\n";
  369.                 if ($count != 7) {
  370.                     &PrintHtml("<B>", "ERROR: Not the correct number of parameters in the first line of $INFOFILENAME\n", "<BR>");
  371.                 }
  372.                 if ($Platform{$ShortDir} =~ /demo|testdrive|install/ && ! -d "$PRODUCTS_DIR/$ShortDir/_install") {
  373.                     &PrintHtml("<B>", "ERROR: Missing _install directory in $ShortDir\n", "<BR>");
  374.                 }
  375.                 if ($HomePageName{$ShortDir} eq "") {
  376.                     &PrintHtml("<B>", "ERROR: Missing Home page name in $ShortDir\n", "<BR>");
  377.                 } else {
  378.                     unless (-s "$PRODUCTS_DIR/$ShortDir/$HomePageName{$ShortDir}") {
  379.                         &PrintHtml("<B>", "ERROR: $HomePageName{$ShortDir} file missing in $ShortDir\n", "<BR>");
  380.                     }
  381.                 }
  382.             }
  383.             $ProdNum = 1;
  384.                     while (<INFOFILE>) {
  385.                 if ($_ =~ /^[     ]*$/ || $_ =~ /^#/) {
  386.                     next;
  387.                 }
  388.                 if ($CHECK eq "true") {
  389.                     unless ($_ =~ /^.*[^     ].*\^$/) {
  390.                         chop($_);
  391.                         &PrintHtml("<B>", "ERROR: Wrong line in $INFOFILENAME: \"$_\"\n", "<BR>");
  392.                     }
  393.                 }
  394.                             $Product=$_;
  395.                             chop($Product);
  396.                             chop($Product);
  397.                             $Products{$ShortDir . $ProdNum} = $Product;
  398.                 #print "jp = $Product\n";
  399.                 $ProdNum++;
  400.                     }
  401.             close(INFOFILE);
  402.             } else {
  403.                     &PrintHtml("", "Can't open $INFOFILENAME\n", "<BR>");
  404.         }
  405.     }
  406.     #foreach $ShortDir (sort keys(%Companies)) {
  407.         #print "$Companies{$ShortDir}, $Description{$ShortDir}, $Platform{$ShortDir}, $ChosenCat{$ShortDir}, $WebSite{$ShortDir}, $Email{$ShortDir}, $HomePageName{$ShortDir}\n";
  408.     #}
  409.     #%RevComp = reverse %Companies;
  410.     #if (@RevComp != @Companies) {
  411.         #print "WARNING: two directory with the same company name->possible problem!\n";
  412.     #}
  413.     %RevProd = reverse %Products;
  414.     if (@RevProd != @Products) {
  415.         &PrintHtml("", "WARNING: two products with the same name->possible problem!\n", "<BR>");
  416.     }
  417.     #print @Products;
  418.     foreach $ShortDir (sort keys(%Products)) {
  419.         print "$ShortDir, $Products{$ShortDir}\n";
  420.     }
  421.     #foreach $ShortDir (sort keys(%RevProd)) {
  422.         #print "$ShortDir, $RevProd{$ShortDir}\n";
  423.     #}
  424.     #foreach $ShortDir (sort keys(%RevComp)) {
  425.         #print "$RevComp{ShortDir}\n";
  426.     #}
  427.     #print %RevComp;
  428. }
  429.  
  430. sub FilteredSortCat
  431. {
  432.     ($al = $Categories{$a}) =~ tr/A-Z/a-z/;
  433.     $al =~ s/^the //;
  434.     $al =~ s/^\.//;
  435.     $al =~ s/^[     ]*//;
  436.  
  437.     ($bl = $Categories{$b}) =~ tr/A-Z/a-z/;
  438.     $bl =~ s/^the //;
  439.     $bl =~ s/^\.//;
  440.     $bl =~ s/^[     ]*//;
  441.  
  442.     $al cmp $bl;
  443. }
  444. sub FilteredSort
  445. {
  446.     ($al = $a) =~ tr/A-Z/a-z/;
  447.     $al =~ s/^the //;
  448.     $al =~ s/^\.//;
  449.     $al =~ s/^[     ]*//;
  450.  
  451.     ($bl = $b) =~ tr/A-Z/a-z/;
  452.     $bl =~ s/^the //;
  453.     $bl =~ s/^\.//;
  454.     $bl =~ s/^[     ]*//;
  455.  
  456.     $al cmp $bl;
  457. }
  458. sub FilteredSortComp
  459. {
  460.     $al = $Companies{$a};
  461.     $al =~ tr/A-Z/a-z/;
  462.     $al =~ s/^the //;
  463.     $al =~ s/^\.//;
  464.     $al =~ s/^[     ]*//;
  465.  
  466.     $bl = $Companies{$b};
  467.     $bl =~ tr/A-Z/a-z/;
  468.     $bl =~ s/^the //;
  469.     $bl =~ s/^\.//;
  470.     $bl =~ s/^[     ]*//;
  471.  
  472.     #print STDOUT "$al =? $bl\n";
  473.     $al cmp $bl;
  474. }
  475.  
  476. ##############################################################################
  477. # CreateSoft
  478. ##############################################################################
  479. sub CreateSoft
  480. {
  481.     &PrintHtml("<BR>", "\nCreating Software page...\n", "<BR>");
  482.     $SOFTFILENAME = "$CAT_DIR/Software.html";
  483.     $SOFTHEADFILENAME = "$CAT_DIR/Software.head.html";
  484.     if (open (SOFTFILE, "> $SOFTFILENAME") && open(SOFTHEADFILE, "> $SOFTHEADFILENAME")) {
  485.         $old = select(SOFTHEADFILE);
  486.         $~ = "SOFTWAREHEAD"; 
  487.         write SOFTHEADFILE;   
  488.         close (SOFTHEADFILE); 
  489.  
  490.         select(SOFTFILE);
  491.         $~ = "CATBEGIN";
  492.         write SOFTFILE;
  493.  
  494.         $Letter = "0";
  495.         foreach $Cat (sort FilteredSortCat keys(%Categories)) {
  496.             unless ($Categories{$Cat} eq "") {
  497.                 $CatAb = $Categories{$Cat};
  498.                 $CatAb =~ tr/a-z/A-Z/;
  499.                 $CatAb =~ s/^THE //;
  500.                 $CatAb =~ s/^\.//;
  501.                 #print STDOUT "$CatAb, $Letter\n";
  502.                 unless ($CatAb =~ /^$Letter/) {
  503.                     $Letter = substr($CatAb, 0, 1);
  504.                     print SOFTFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  505.                     #push (@Letters, $Letter);
  506.  
  507.                 }
  508.                   #height of each category head, default 150            
  509.                     if ($CatHeight{$Cat} == "") {
  510.                      $height = "150";
  511.                 } else {
  512.                      $height = $CatHeight{$Cat};
  513.                 }    
  514.                 print SOFTFILE "<DD><a href=\"http://localhost:7999/cgi-bin/show.bat/?DEST=$Cat&SIZE=$height\"><B>$Categories{$Cat}</B></a><br>\n";
  515.             }
  516.         }
  517.         $~ = "CATEND";
  518.         write SOFTFILE;
  519.  
  520.         close (SOFTFILE);
  521.         select($old);
  522.     }
  523.     &PrintHtml("<DD>", "\tSoftware.html page created.\n", "<BR>");
  524. }
  525.  
  526. ##############################################################################
  527. # CreateCat: 
  528. ##############################################################################
  529. sub CreateCat
  530. {
  531.  
  532.     foreach $catword  ( sort keys(%Categories)) {
  533.         #chop $catword;
  534.         &PrintHtml("<BR>", "\nCreating $catword category page ...\n", "<BR>");
  535.              $CATFILENAME = "$CAT_DIR/$catword.html";
  536.              $CATHEADFILENAME = "$CAT_DIR/$catword.head.html";
  537.         #print STDOUT "Bef open, $CATFILENAME, $CATHEADFILENAME\n";
  538.         if (open (CATFILE, "> $CATFILENAME") && open(CATHEADFILE, "> $CATHEADFILENAME")) {
  539.             $old = select(CATFILE);
  540.  
  541.             $~ = "CATBEGIN";
  542.             write CATFILE;
  543.             $Letter = "0";
  544.             @Letters = ();
  545.             foreach $ShortName (sort FilteredSortComp keys(%Companies)) {
  546.                 $Comp = $Companies{$ShortName};
  547.                 #print STDOUT "$ShortName, $Comp\n";
  548.                 
  549.                 unless ($ChosenCat{$ShortName} =~ /$catword/ 
  550.                     || $catword eq "companies") {
  551.                     next;
  552.                 }
  553.                 $CompAb = $Comp;
  554.                 $CompAb =~ tr/a-z/A-Z/;
  555.                 $CompAb =~ s/^THE //;
  556.                 $CompAb =~ s/^\.//;
  557.                 unless ($CompAb =~ /^$Letter/) {
  558.                     $Letter = substr($CompAb, 0, 1);
  559.                     print CATFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  560.                     push (@Letters, $Letter);
  561.                 }
  562.  
  563.                     #print CATFILE "     <DD><a HREF=http://localhost:7999/$ShortName/$HomePageName{$ShortName}><B>$Comp</B></a> $Description{$ShortName}\n";
  564.                     print CATFILE "     <DD><a HREF=http://localhost:7999/$ShortName/$FRAMEBASICNAME><B>$Comp</B></a> $Description{$ShortName}\n";
  565.                                 print "<dd><b><i>", $Products{$ShortName . "1"}, "</i></b>\n" ;                             
  566.                                 if ($Products{$ShortName . "2"} ne "") {
  567.                                         print ", <b><i>", $Products{$ShortName . "2"}, "</i></b>\n" ;
  568.                                 }
  569.                                 if ($Products{$ShortName . "3"} ne "") {
  570.                                         print ", <b><i>", $Products{$ShortName . "3"}, "</i></b>\n" ;
  571.                                 }
  572.                                 if ($Products{$ShortName . "4"} ne "") {
  573.                                         print ", <b><i>", $Products{$ShortName . "4"}, "</i></b>\n" ;
  574.                                 }
  575.                                 if ($Products{$ShortName . "5"} ne "") {
  576.                                         print ", <b><i>", $Products{$ShortName . "5"}, "</i></b>\n" ;
  577.                                 }
  578. #
  579. #        This is for testdrive, install, and demo images
  580. #
  581.                 if ($Platform{$ShortName} =~ /demo/ ) {
  582.                 print CATFILE "<img src=\"http://localhost:7999/SunSolutions/images/demo.gif\">";
  583.                 }
  584.                                 if ($Platform{$ShortName} =~ /testdrive/ ) { 
  585.                                 print CATFILE "<img src=\"http://localhost:7999/SunSolutions/images/testdrive.gif\">";
  586.                                 } 
  587.                                 if ($Platform{$ShortName} =~ /install/ ) { 
  588.                 print CATFILE "<img src=\"http://localhost:7999/SunSolutions/images/install.gif\">";
  589.                                 } 
  590.                 print CATFILE "\n";
  591.  
  592.                 }
  593.          
  594.         
  595.             $~ = "CATEND";
  596.             write CATFILE;
  597.             close (CATFILE);
  598.         
  599.             if ($Special{$catword} eq "") {
  600.                 $AppWidth="596"; 
  601.                  $AppHeight="75";
  602.             } else {
  603.                 @tmp=split(/,/,$Special{$catword});
  604.                                 $AppWidth=@tmp[0]; 
  605.                 $AppHeight=@tmp[1];
  606.             } 
  607.                 
  608.                         #&PrintHtml("<DD>", "\ttest $AppWidth $AppHeight $Special{$catword} $catword\n", "<BR>");
  609.  
  610.             select(CATHEADFILE);
  611.             $~ = "CATHEADERBEGIN";
  612.             write CATHEADFILE;
  613.  
  614.         print CATHEADFILE "<IMG border=0 SRC=\"$DIR_IMAGES/$GifImage{$catword}\"  alt=\"\" USEMAP=#banner ismap>";
  615.         #if ($catword ne "companies") {
  616.         #    print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=companies\" COORDS=27,4,96,44>\n";
  617.         #} else {
  618.         print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=companies\" COORDS=7,12,69,40>\n";
  619.         #}
  620.         print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=products\" COORDS=3,48,69,80>\n";
  621.         #if ($catword ne "Hardware") {
  622.         #print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Hardware\" COORDS=96,0,165,40>\n";
  623.         #} else {
  624.         print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/docs\/info\/Info.html\" COORDS=73,6,142,46>\n";
  625.         #}
  626.         #if ($catword ne "Services" && $catword ne "companies" && $catword ne "internet") {
  627.             #        print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Services\" COORDS=96,38,165,78>\n";
  628.         #} else {
  629.             print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/index.html\" COORDS=72,40,143,85>\n";
  630.         #}
  631.                 #if ($catword eq "Sun") {
  632.         #    print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Sun_Software&SIZE=35\" COORDS=198,85,366,170>\n";
  633.         #    print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Sun_Hardware&SIZE=35\" COORDS=401,85,575,170>\n";
  634.         #}
  635.         #if ($catword eq "internet") {
  636.         #print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"../.Internet/cover.htm\" COORDS=180,0,596,166>\n";
  637.         #} else {
  638.         #print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http://localhost:7999/SunSolutions/index.html\" COORDS=198,0,596,62>\n";
  639. #}
  640.         $~ = "CATHEADERMIDDLE";
  641.         write CATHEADFILE;
  642.  
  643.                 #print CATHEADFILE `cat $Header{$catword}`;
  644.             unless ($Categories{$catword} eq "") {
  645.  
  646. #Commented out on 1/20/97 Jason for March 97
  647.  
  648.                     #print CATHEADFILE "<CENTER><FONT SIZE=24>$Categories{$catword}</FONT></CENTER>";
  649.             }
  650. #Comment STOP Here Jason
  651.     
  652.             #@Letters = ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
  653.             if (@Letters > 7) {
  654.                 print CATHEADFILE "<B>Go to:  ";
  655.                 foreach $letter (@Letters) {
  656.                     print CATHEADFILE "<A HREF=\"?DEST=$catword&L=$letter" . ($Categories{$catword} eq ""? "" : "&SIZE=180") . "\">$letter</A>\n";
  657.                 }
  658.             }
  659. #Added by Jason 1/20/97 for March 97 Category Owners
  660.             if ($catword eq "financial") {
  661.             print CATHEADFILE "<center><img src=/SCO/ad/ad.gif></center>";
  662.             }
  663.             $~ = "CATHEADEREND";
  664.             write CATHEADFILE;
  665.             close (CATHEADFILE);
  666.      
  667.             &PrintHtml("<DD>", "\t$catword category page created.\n", "<BR>");
  668.  
  669.             select($old);
  670.         } else {
  671.             die "\nERROR: Cannot write $CATFILENAME or $CATHEADFILENAME!\nTry to be superuser!\n\n";
  672.         }
  673.     }
  674. }
  675.  
  676. ##############################################################################
  677. # CreateReport:
  678. ##############################################################################
  679. sub CreateReport
  680. {
  681.     $TotalSize = 0;
  682.     foreach $ShortName (sort FilteredSortComp keys(%Companies)) {
  683.         #$ShortName = $RevComp{$Comp};    
  684.         $Comp = $Companies{$ShortName};
  685.         &PrintHtml("<B>", "$Comp:\n", "</B><BR>");
  686.         &PrintHtml("<DD>", "\tProduct1: " . $Products{$ShortName . "1"} . "\n", "<BR>");
  687.         if ($Products{$ShortName . "2"} ne "") {
  688.             &PrintHtml("<DD>", "\tProduct2: " . $Products{$ShortName . "2"} . "\n", "<BR>");
  689.         }
  690.         if ($Products{$ShortName . "3"} ne "") {
  691.             &PrintHtml("<DD>", "\tProduct3: " . $Products{$ShortName . "3"} . "\n", "<BR>");
  692.         }
  693.         if ($Products{$ShortName . "4"} ne "") {
  694.             &PrintHtml("<DD>", "\tProduct4: " . $Products{$ShortName . "4"} . "\n", "<BR>");
  695.         }
  696.         if ($Products{$ShortName . "5"} ne "") {
  697.             &PrintHtml("<DD>", "\tProduct5: " . $Products{$ShortName . "5"} . "\n", "<BR>");
  698.         }
  699.         $Size = `du -ks $PRODUCTS_DIR/$ShortName`;
  700.         chop $Size;
  701.         $Size =~ s/(\d*).*/\1/;
  702.         &PrintHtml("<DD>", "\tTotal size: $Size Kb\n", "<BR>");
  703.         $TotalSize += $Size;
  704.         if ( $Platform{$ShortName} =~ /demo|testdrive|install/) {
  705.             &PrintHtml("<DD>", "\t", "");
  706.             if ($Platform{$ShortName} =~ /demo/) {
  707.                 &PrintHtml("", "Slide-show, ", "");
  708.             }
  709.             if ($Platform{$ShortName} =~ /testdrive/) {
  710.                 &PrintHtml("", "Demo version, ", "");
  711.             }
  712.             if ($Platform{$ShortName} =~ /install/) {
  713.                 &PrintHtml("", "Unlockable version, ", "");
  714.             }
  715.             &PrintHtml("", "\n", "<BR>");
  716.         }
  717.     }
  718.     &PrintHtml("<BR><BR>", "\n\nTotal size for all companies: $TotalSize Kb\n", "<BR>");
  719.     $Size = `du -ks $PRODUCTS_DIR/$ShortName`;
  720.     chop $Size;
  721.     $Size =~ s/(\d*).*/\1/;
  722.     &PrintHtml("", "Total size for .products: $Size Kb\n", "<BR>");
  723. }
  724.  
  725. ##############################################################################
  726. # CreateApplet:
  727. ##############################################################################
  728. sub CreateApplet
  729. {
  730.     &PrintHtml("", "\nBuilding Control bar applets ...\n", "<BR>");
  731.     $TmpFile = "/tmp/tmpupdateapplet";
  732.     foreach $Comp (sort keys(%Companies)) {
  733.         $FRAMEFILENAME = "$PRODUCTS_DIR/$Comp/$FRAMEBASICNAME";
  734.         if (open (FRAMEFILE, "> $FRAMEFILENAME")) {
  735.             print FRAMEFILE "<html> <head>\n<title>Sun Solutions October 1996: $Companies{$Comp}</title>\n</head>\n<FRAMESET ROWS=\"50,*\">\n<FRAME SCROLLING=\"no\" TARGET=\"_top\" NAME=\"menu\" NORESIZE SRC=\"SunSolutions.head.html\">\n<FRAME SCROLLING=\"yes\" NAME=\"content\" NORESIZE MARGINHEIGHT=4 SRC=\"$HomePageName{$Comp}\">\n</BODY> </NOFRAME> </FRAMESET> </HTML>\n";
  736.             close(FRAMEFILE);
  737.         } else {
  738.             &PrintHtml("", "ERROR: Couldn't write $FRAMEFILENAME\n", "<BR>");
  739.         }
  740.  
  741.         $HEADFILENAME = "$PRODUCTS_DIR/$Comp/$HEADBASICNAME";
  742.         if (open (HEADFILE, "> $HEADFILENAME")) {
  743.             print HEADFILE "<html> <head>\n<title>Sun Solutions October 1996</title>\n</head>\n<BODY BACKGROUND=../SunSolutions/images/back3.gif>\n<CENTER>\n<applet code=ImageMap.class width=596 height=36>\n<param name=highlight value=\"brighter60\">";
  744.             
  745.             $TestGif = 0;
  746.             if ($Platform{$Comp} =~ /demo/) {
  747.                 $TestGif ++;
  748.             }
  749.             if ($Platform{$Comp} =~ /testdrive/) {
  750.                 $TestGif += 2;
  751.             }
  752.             if ($Platform{$Comp} =~ /install/) {
  753.                 $TestGif += 4;
  754.             }
  755.             @BarFileNames = ("none", "rd", "td", "tdrd", "ts", "tsrd", "tdts", "samplebar");
  756.             print HEADFILE "<param name=img value=\"$PRODUCTS_DIR/SunSolutions/images/$BarFileNames[$TestGif].gif\">\n";
  757.  
  758.             print HEADFILE "<param name=area1 value=\"HrefButtonArea,0,0,80,35,http://localhost:7999/cgi-bin/show.bat/?DEST=companies\" >\n";
  759.             print HEADFILE "<param name=area2 value=\"HrefButtonArea,81,0,84,35,http://localhost:7999/SunSolutions/search.html\" >\n";
  760.             print HEADFILE "<param name=area3 value=\"HrefButtonArea,164,0,83,35,http://localhost:7999/SunSolutions/docs/info/Info.html\" >\n";
  761.             print HEADFILE "<param name=area4 value=\"HrefButtonArea,267,0,85,35,http://localhost:7999/cgi-bin/req_more_info.pl?$Comp\" >\n";
  762.  
  763.             $Area = 5;
  764.             if ($Platform{$Comp} =~ /demo/) {
  765.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,350,0,83,35,http://localhost:7999/$Comp/_install/install_show.sh\">\n";
  766.                 $Area ++;
  767.             }
  768.             if ($Platform{$Comp} =~ /testdrive/) {
  769.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,434,0,81,35,http://localhost:7999/$Comp/_install/run.sh\">\n";
  770.                 $Area ++;
  771.             }
  772.             if ($Platform{$Comp} =~ /install/) {
  773.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,515,0,83,35,http://localhost:7999/$Comp/_install/install.sh\">\n";
  774.             }
  775.             
  776.             print HEADFILE "</applet> </CENTER> </BODY> </HTML>\n";
  777.  
  778.  
  779.             close(HEADFILE);
  780.         } else {
  781.             &PrintHtml("", "ERROR: Couldn't write $HEADFILENAME\n", "<BR>");
  782.         }
  783.  
  784.              #$HOMEFILENAME = "../$Comp/" . $HomePageName{$ShortDir};
  785.         #if (open (HOMEFILE, "$HOMEFILENAME")) {
  786.             #open (TMPFILE, "$TmpFile");
  787.             #while (<TMPFILE>) {
  788.                 #$Line = $_;
  789.                 #if ($Line =~ /^<applet class=cdbar/i) {
  790.                     #while (! <HOMEFILE> =~ /^<\/applet>/i) {
  791.                     #}
  792.                     #$TestGif = 0;
  793.                     #if ($Platform{$Comp} =~ /demo/) {
  794.                         #$TestGif ++;
  795.                     #}
  796.                     #if ($Platform{$Comp} =~ /testdrive/) {
  797.                         #$TestGif ++;
  798.                     #}
  799.                     #if ($Platform{$Comp} =~ /install/) {
  800.                         #$TestGif ++;
  801.                     #}
  802.                     #print TMPFILE "<app class=CDbar img=\"http://localhost:7999/SunSolutions/images/none.gif";
  803.                     #print TMPFILE "highlight=brighter60";
  804. ##            print "area1=HrefButtonArea,0,0,80,35,http://localhost:7999/SunSolutions/index.html" >> applet
  805. ##            print "area2=HrefButtonArea,81,0,84,35,http://localhost:7999/.categories/companies.html" >> applet
  806. ##            print "area3=HrefButtonArea,164,0,83,35,http://localhost:7999/SunSolutions/docs/info/Info.html" >> applet
  807. ##            print "area4=HrefButtonArea,267,0,85,35,http://localhost:7999/DEV/disabled.html" >> applet
  808. ##            print ">" >> applet
  809. ##                        breaksw    
  810. ## 
  811.                     #next;
  812.                 #}
  813.                 #print TMPFILE $Line;
  814.             #}
  815.         #}
  816.         #rename($TmpFile, $HOMEFILENAME);
  817.     }
  818.     &PrintHtml("", "\tControl bar applets built...\n", "<BR>");
  819. }
  820. ###############################################################################
  821. ## CreateNames
  822. ###############################################################################
  823. sub CreateNames
  824. {
  825. open (REALNAMES, "> $PRODUCTS_DIR/.bin/real_names.txt");
  826.    write REALNAMES;
  827.     foreach $comp (keys(%Companies)) {
  828.         print REALNAMES "$comp\t$Companies{$comp}\n";
  829.     }
  830. # this is for directories without _info files
  831.    print REALNAMES "SunProducts\tSun Products\n";
  832.    print REALNAMES ".Internet\tInternet Articles\n";
  833. close(REALNAMES);
  834. }
  835.  
  836. ###############################################################################
  837. ## CreateProduct
  838. ###############################################################################
  839. sub CreateProduct
  840. {
  841.     &PrintHtml("<BR>", "\nCreating Products page...\n", "<BR>");
  842.  
  843.          $PRODFILENAME = "$CAT_DIR/products.html";
  844.          $PRODHEADFILENAME = "$CAT_DIR/products.head.html";
  845.     if (open (PRODFILE, "> $PRODFILENAME") && open(PRODHEADFILE, "> $PRODHEADFILENAME")) {
  846.         $old = select(PRODFILE);
  847.  
  848.         $~ = "CATBEGIN";
  849.         write PRODFILE;
  850.         $Letter = "0";
  851.         @Letters = ();
  852.         foreach $Prod (sort FilteredSort keys(%RevProd)) {
  853.             $ShortName = substr($RevProd{$Prod}, 0, length($RevProd{$Prod}) - 1);    
  854.             
  855.             #print STDOUT "        Prod=$Prod, ShortName=$ShortName.\n";
  856.             $ProdAb = $Prod;
  857.             $ProdAb =~ tr/a-z/A-Z/;
  858.             $ProdAb =~ s/^THE //;
  859.             $ProdAb =~ s/^\.//;
  860.             $ProdAb =~ s/^[     ]*//;
  861.             unless ($ProdAb =~ /^$Letter/) {
  862.                 $Letter = substr($ProdAb, 0, 1);
  863.                 print PRODFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  864.                 push (@Letters, $Letter);
  865.             }
  866.  
  867.                 #print PRODFILE "<DD><A HREF=http://localhost:7999/$ShortName/$HomePageName{$ShortName}><B>$Prod</B></A> <I>from</I> <B>$Companies{$ShortName}</B>\n";
  868.                 print PRODFILE "<DD><A HREF=http://localhost:7999/$ShortName/$FRAMEBASICNAME><B>$Prod</B></A> <I>from</I> <B>$Companies{$ShortName}</B>";
  869. #
  870. #     this is for testdrive, install, demo icons
  871. #
  872.                                 if ($Platform{$ShortName} =~ /demo/ ) {
  873.                                 print PRODFILE "<img src=\"http://localhost:7999/SunSolutions/images/demo.gif\">";
  874.                                 }
  875.                                 if ($Platform{$ShortName} =~ /testdrive/ ) {
  876.                                 print PRODFILE "<img src=\"http://localhost:7999/SunSolutions/images/testdrive.gif\">";
  877.                                 }
  878.                                 if ($Platform{$ShortName} =~ /install/ ) {
  879.                                 print PRODFILE "<img src=\"http://localhost:7999/SunSolutions/images/install.gif\">";
  880.                                 }
  881.                                 print PRODFILE "\n";
  882.  
  883.             }
  884.      
  885.         $~ = "CATEND";
  886.         write PRODFILE;
  887.         close (PRODFILE);
  888.  
  889.         select(PRODHEADFILE);
  890.         $~ = "CATHEADERBEGIN";
  891.         write PRODHEADFILE;
  892.                 print PRODHEADFILE "<IMG border=0 SRC=\"$DIR_IMAGES/products.gif\"  alt=\"\" USEMAP=#banner ismap>";
  893.         print PRODHEADFILE "<MAP Name=\"banner\">";
  894.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=companies\" COORDS=7,12,69,40>\n";
  895.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=products\" COORDS=3,48,69,80>\n";
  896.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/docs\/info\/Info.html\" COORDS=73,6,142,46>\n";
  897.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/index.html\" COORDS=72,40,143,85>\n";
  898.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http://localhost:7999/SunSolutions/index.html\" COORDS=200,0,595,74>\n";
  899.  
  900.         print PRODHEADFILE "</MAP></td><tr><td><center>";
  901.         #$~ = "CATHEADERMIDDLE";
  902.         #write PRODHEADFILE;
  903.  
  904.             #print PRODHEADFILE `cat $Header{$catword}`;
  905.         #unless ($Categories{$catword} eq "") {
  906.                 #print PRODHEADFILE "<H1>$Categories{$catword}</H1>";
  907.         #}
  908.  
  909.         #@Letters = ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
  910.         print PRODHEADFILE "<B><FONT size=\"4\"> Go to:\n";
  911.         foreach $letter (@Letters) {
  912. # below changed by Marc
  913.             #print PRODHEADFILE "<A HREF=\"?DEST=$catword&L=$letter\">$letter</A>\n";
  914.             print PRODHEADFILE "<A HREF=\"?DEST=products&L=$letter\">$letter</A>\n";
  915.         }
  916.         $~ = "CATHEADEREND";
  917.         write PRODHEADFILE;
  918.         close (PRODHEADFILE);
  919.  
  920.         &PrintHtml("<DD>", "\tproducts.html page created.\n", "<BR>");
  921.  
  922.         select($old);
  923.     }
  924. }
  925. ##############################################################################
  926. # MAIN PART: Decode the parameters and calls the correct subfunctions
  927. ##############################################################################
  928. #$arg0=$0
  929. #$DIR=$arg0:h
  930. #$ProgName=$arg0:t
  931.  
  932. #if ("X$DIR" == "X$ProgName") {
  933.     #$DIR='.'
  934. #}
  935.  
  936. #if (-e "./$ProgName") {
  937.     #$DIR=$cwd
  938. #}
  939.  
  940. #cd  $DIR
  941. #print `pwd`;
  942.  
  943. #
  944. # Create the category pages seen in the categories.txt file
  945. #
  946.  
  947. #foreach $en (sort keys %ENV) {
  948.     #print "$en = $ENV{$en}\n";
  949. #}
  950.  
  951.  
  952.     $CATS = "false";
  953.     $APPLETS = "false";
  954.     $COMP = "false";
  955.     $CHECK = "false";
  956.     $REPORT = "false";
  957.     $HTML_FORMAT = "false";
  958.     $PROD = "false";
  959.     $SOFT = "false";
  960.     $PLATFORM = "sparc";
  961.  
  962.     $DIR_IMAGES = "http://localhost:7999/SunSolutions/images/";
  963.     $PRODUCTS_DIR = "../";
  964.  
  965.     # parse command line arguements
  966.  
  967.     #print "Arg=@ARGV.\n";
  968.     @ARGREPORT = @ARGV;
  969.     if (@ARGV == 0) {
  970.         @ARGV=("-?");
  971.     }
  972.  
  973.         while ($ARGV[0] =~ /^-/) {
  974.             $_ = shift;
  975.             #print "Arg=$_.\n";
  976.             if (/^-cats$/) {
  977.                 $CATS = "true";
  978.             } elsif (/^-applets/) {
  979.                 $APPLETS = "true";
  980.             } elsif (/^-comp/) {
  981.                 $COMP = "true";
  982.             } elsif (/^-checkall/) {
  983.                 $CHECK = "true";
  984.                 $CHECKLINKS = "true";
  985.             } elsif (/^-checklinks/) {
  986.                 $CHECKLINKS = "true";
  987.             } elsif (/^-check/) {
  988.                 $CHECK = "true";
  989.             } elsif (/^-soft/) {
  990.                 $SOFT = "true";
  991.             } elsif (/^-report/) {
  992.                 $REPORT = "true";
  993.             } elsif (/^-html/) {
  994.                 $HTML_FORMAT = "true";
  995.                         } elsif (/^-names/) {
  996.                                 $NAMES = "true";
  997.             } elsif (/^-dir/) {
  998.                 $PRODUCTS_DIR = ($1 ? $1 : shift);
  999.                 unless (-s $PRODUCTS_DIR) {
  1000.                     die "ERROR: $PRODUCTS_DIR is not a directory\n";
  1001.                 }
  1002.             } elsif (/^-prod/) {
  1003.                 $PROD = "true";
  1004.             } elsif (/^-all/) {
  1005.                 $PROD = "true" ;
  1006.                 $COMP = "true";
  1007.                 $SOFT = "true";
  1008.                 $APPLETS = "true";
  1009.                 $CATS = "true";
  1010.                 $NAMES = "true";
  1011.             } elsif (/^-x86/) {
  1012.                 $PLATFORM = x86;
  1013.                 $SRC_DIR = "../../../x86.image";
  1014.             } elsif (/^-[?Hh]/) {
  1015.                 die "Usage: update.pl [ -cats | -applets | -soft | -prod | -all | -dir dirname | -x86  | -report | -html | -names | -check]\n\tall: = -cats -prod -applets\n\tapplets: creates an applet in the customer home page.\n\tcats: creates the category and company pages.\n\tcheck: check the _info file, and other things for errors.\n\tdir: gives the directory where the companies are located.\n\thtml: when -report is selected, creates an output in HTML format.\n\tnames: create list of company names keyed on directory name.\n\tprod: creates the product page.\n\treport: creates a report for all companies.\n\tsoft: creates the Software pages\n\tx86: for future usage.\n";
  1016.             } else {
  1017.                 die "Unrecognized switch: $_ (try -?)\n";
  1018.             }
  1019.         }
  1020.  
  1021. &PrintHtml("<HTML> <HEAD> <title>Sun Solutions - status on " . `date` . "</title> </HEAD> <BODY BACKGROUND=../SunSolutions/images/back3.gif bgcolor=\"#DDDDDD\"><H1>", "Sun Solutions - status on " . `date` . "\n", "</H1>");
  1022.  
  1023.  
  1024. # check if root user
  1025. if ( $ENV{"USER"} ne "root" ) {
  1026.         &PrintHtml("", "WARNING: This program should be run as root user.\n", "<BR>");
  1027.     }
  1028.  
  1029.  
  1030.     if ($REPORT ne "true") {
  1031.         $HostName = `hostname`;
  1032.         chop $HostName;
  1033.         &PrintHtml("", "\nUpdating Sun Solutions on $HostName:\n\n", "<BR>");
  1034.     if (open (REPORTFILE, ">> $PRODUCTS_DIR/.update.txt")) {
  1035.         $Date = `date`;
  1036.         chop $Date;
  1037.         print REPORTFILE "update by " . $ENV{"USER"} . " on $Date from $HostName\n\tparams: ";
  1038.         while (@ARGREPORT) {
  1039.             print REPORTFILE "$ARGREPORT[0], ";
  1040.             shift @ARGREPORT;
  1041.         }
  1042.         print REPORTFILE "\n\n";
  1043.         close (REPORTFILE);
  1044.     } else {
  1045.         &PrintHtml("", "WARNING: Cannot open $PRODUCTS_DIR/.update.txt\n", "<BR>");
  1046.     }
  1047. }
  1048.  
  1049. &InitCompInfo();
  1050.  
  1051. $CAT_DIR = "$PRODUCTS_DIR/.categories";
  1052. $FRAMEBASICNAME = "SunSolutions.frame.html";
  1053. $HEADBASICNAME = "SunSolutions.head.html";
  1054. #print $CAT_DIR;
  1055. if ( ! -d $CAT_DIR ) {
  1056.     mkdir($CAT_DIR, 0777);
  1057. }
  1058.  
  1059. if ( $CHECK eq "true" ) {
  1060.     &CheckFiles();
  1061. }
  1062. if ( $NAMES eq "true" ) {
  1063.         &CreateNames();  
  1064. }
  1065.  
  1066.  
  1067. if ( $CHECKLINKS eq "true" ) {
  1068.     &CheckLinks();
  1069. }
  1070.  
  1071. if ( $CATS eq "true" ) {
  1072.     &CreateCat();
  1073. }
  1074.  
  1075. if ( $SOFT eq "true" ) {
  1076.     &CreateSoft();
  1077. }
  1078.  
  1079. #
  1080. # Get all SunSolutions menu bar components and put in file 
  1081. # for building of front page applet 
  1082. #
  1083. if ( $APPLETS eq "true" ) {
  1084.     &CreateApplet();
  1085. }
  1086.  
  1087. if ( $PROD eq "true" ) {
  1088.     &CreateProduct();
  1089. }
  1090.  
  1091. if ( $REPORT eq "true" ) {
  1092.     &CreateReport();
  1093. }
  1094.  
  1095. #
  1096. # Compile list of companies, place in 'companies' file
  1097. #
  1098. #if ( $COMP eq "true" ) {
  1099.     #&CreateComp();
  1100. #}
  1101.  
  1102. #
  1103. # Compile list of products, place in 'products' file
  1104. #
  1105.  
  1106. #print "\n\n\nPress <RETURN> to close the window and test your submission..\n.";
  1107. #read answer;
  1108.  
  1109. ################################################################################
  1110. # Define FORMATS (no more code)
  1111. ################################################################################
  1112. format CATHEADERBEGIN =
  1113. <html>
  1114. <body  BGCOLOR="#8c8cde" link=#33ff00 vlink=#33ff00 >
  1115. <BASE TARGET="_top" HREF="http://localhost:7999/cgi-bin/show.bat/">
  1116. <center>
  1117. <form method="get"  ACTION="http://localhost:7999/cgi-bin/brandnewwais.pl/wais_SunSolutions">
  1118. <table border = 3><td>
  1119. <MAP Name="banner">
  1120. .
  1121.  
  1122. format CATHEADERMIDDLE =
  1123. </MAP></td><tr><td><center>
  1124. <B><FONT size="4">
  1125. #<B>Go to:  </b>
  1126. .
  1127.  
  1128. format CATHEADEREND =
  1129. #<br> Search: <input type="text" name="isindex" size="12" >
  1130. </font>
  1131. </td><tr></table>
  1132. </form>
  1133. </center>
  1134. </body>
  1135. </html>
  1136. .
  1137.  
  1138. format CATBEGIN =
  1139. <HTML>
  1140.         <!-- header section-->
  1141. <HEAD>
  1142. <title>Sun Solutions - October</title>
  1143. </HEAD>
  1144.         <!-- document body-->
  1145. <BODY  BACKGROUND=../SunSolutions/images/back3.gif bgcolor="#DDDDDD">
  1146. <BASE TARGET="_top">
  1147. <DL>
  1148. #<hr>
  1149. #<p>
  1150. .
  1151.  
  1152. format CATEND =
  1153. </B></B><DT>
  1154. <hr>
  1155. </BODY>
  1156. </HTML>
  1157. .
  1158.  
  1159. format SOFTWAREHEAD =
  1160. <HTML>
  1161.         <!-- header section-->
  1162. <HEAD>
  1163. <TITLE>Sun Solutions - Software Categories</TITLE>
  1164. </HEAD>
  1165.         <!-- document body-->
  1166. <BODY BGCOLOR="8c8cde" link=#33ff00 vlink=#33ff00>
  1167. <CENTER>
  1168. <BASE TARGET="_top" HREF="http://localhost:7999/cgi-bin/show.bat/">
  1169. <form method="get"  ACTION="http://localhost:7999/cgi-bin/brandnewwais.pl/wais_SunSolutions">
  1170. <table border = 3><td>
  1171. <IMG border=0 SRC="http://localhost:7999/SunSolutions/images/software.gif" alt="" USEMAP=#banner ismap>
  1172. <MAP Name="banner">
  1173. <AREA SHAPE="RECT" HREF="?DEST=companies" COORDS=7,12,69,40>
  1174. <AREA SHAPE="RECT" HREF="?DEST=products" COORDS=3,48,69,80>
  1175. <AREA SHAPE="RECT" HREF="http://localhost:7999/SunSolutions/docs/info/Info.html" COORDS=73,6,142,46>
  1176. <AREA SHAPE="RECT" HREF="http://localhost:7999/SunSolutions/index.html" COORDS=72,40,143,85>
  1177. <AREA SHAPE="RECT" HREF="http://localhost:7999/SunSolutions/index.html" COORDS=200,0,595,74>
  1178. </MAP>
  1179. </TD><TR><TD>
  1180. <CENTER>
  1181. <FONT size="4">
  1182. #<br>Search: <input type="text" name="isindex" size="12" >
  1183. </font>
  1184. </CENTER>
  1185. </td><tr></table>
  1186. </CENTER>
  1187. </form>
  1188. </BODY>
  1189. </HTML>
  1190. .
  1191. ##############################################################################
  1192. format FRAMEHEADER =
  1193. Content-type: text/html
  1194.  
  1195.  
  1196.  
  1197. <html>
  1198. <head>
  1199. <title>Sun Solutions October 1996</title>
  1200. </head>
  1201. <FRAMESET ROWS="20,80">
  1202. #$size
  1203. .
  1204. ##############################################################################
  1205. format FRAMEFOOTER =
  1206. <BODY BACKGROUND="icons/bkgrnds/homebg.gif" body  BACKGROUND=../SunSolutions/images/back3.gif bgcolor=black text=#ffffff link=#dddddd alink=#ffff00 vlink=#bbbbbb>
  1207.  
  1208. <FONT SIZE=-1>Copyright \0511995 <B><A
  1209.  
  1210. </BODY>
  1211. </NOFRAME>
  1212. </FRAMESET>
  1213. </HTML>
  1214. .
  1215.